package wxy.ChainOfResponsibility;

public class Director extends Approver{
    public Director(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if(request.getAmount() < 50000){
            System.out.println(name+"主任审批通过， 金额为" + request.getAmount());
        }
        else if(successor != null){
            successor.processRequest(request);
        }
        else{
            System.out.println("审批未成功");
        }
    }
}